package com.aki.ai_property.controller;

import com.aki.ai_property.entity.Affiche;
import com.aki.ai_property.service.intf.AfficheService;
import com.aki.ai_property.vo.PageBean;
import com.aki.ai_property.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 34553
 * @date 2022/8/27
 */
@RestController
@RequestMapping("/api/affiche/")
public class AfficheController {

    @Autowired
    private AfficheService service;
    /**新增*/
    @PostMapping  ("save.do")
    public Result save(Affiche affiche){
        return service.save(affiche);
    }
    /**修改*/
    @PostMapping("update.do")
    public Result update(Affiche affiche){
        return service.update(affiche);
    }
    /**删除*/
    @GetMapping("delete.do")
    public Result del(int id){
        return service.delete(id);
    }
    /**查询*/
    @GetMapping("page.do")
    public PageBean page(String name, int page, int limit){
        return service.selectPage(name, page, limit);
    }

}
